
<c:choose>
<c:when test='<%= tabs2.equals("New") %>'>

<%
List<Others> othersNew = OthersLocalServiceUtil.getByStatus(0);

SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List newResults = ListUtil.subList(othersNew, searchContainer.getStart(), searchContainer.getEnd());
int total = othersNew.size();
searchContainer.setTotal(total);

%>
<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>
<%
for(int i=0; i<newResults.size(); i++){

		Others others = (Others) newResults.get(i);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= others.getFirstName() %></td>
			<td><%= others.getMiddleName() %></td>
			<td><%= others.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.NORMAL.toString() %>" var="viewOther">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewOther" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewOther %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveOthers">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveOthers" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveOthers %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Approved") %>'>

<%
List<Others> othersApproved = OthersLocalServiceUtil.getByStatus(1);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List approvedResults = ListUtil.subList(othersApproved, searchContainer.getStart(), searchContainer.getEnd());
int total = othersApproved.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>
<%
for(int i=0; i<approvedResults.size(); i++){

		Others others = (Others) approvedResults.get(i);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= others.getFirstName() %></td>
			<td><%= others.getMiddleName() %></td>
			<td><%= others.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewOther">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewOther" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewOther %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="removeOthers">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="removeOthers" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="remove" message="Approve" url="<%= removeOthers %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Pending") %>'>

<%
List<Others> othersPending = OthersLocalServiceUtil.getByStatus(2);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List pendingResults = ListUtil.subList(othersPending, searchContainer.getStart(), searchContainer.getEnd());
int total = othersPending.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>
<%
for(int i=0; i<pendingResults.size(); i++){

		Others others = (Others) pendingResults.get(i);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= others.getFirstName() %></td>
			<td><%= others.getMiddleName() %></td>
			<td><%= others.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewOther">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewOther" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewOther %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveOthers">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveOthers" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveOthers %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Rejected") %>'>

<%
List<Others> othersRejected = OthersLocalServiceUtil.getByStatus(3);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List rejectedResults = ListUtil.subList(othersRejected, searchContainer.getStart(), searchContainer.getEnd());
int total = othersRejected.size();
searchContainer.setTotal(total);
%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>
<%
for(int i=0; i<rejectedResults.size(); i++){

		Others others = (Others) rejectedResults.get(i);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= others.getFirstName() %></td>
			<td><%= others.getMiddleName() %></td>
			<td><%= others.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewOther">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewOther" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewOther %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveOthers">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveOthers" />
				<portlet:param name="othersId" value="<%= String.valueOf(others.getOthersId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveOthers %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>
</c:choose>